import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedPlugin from '@/utils/createPersistedPlugin.js'
const persistedPlugin = createPersistedPlugin()
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: '',
    userId: '',
    imageUrl: '',
    currentId: 0
  },
  getters: {
  },
  mutations: {
    setCurrentId (state, id) {
      state.currentId = id
    },
    setToken (state, token) {
      state.token = token
    },
    setUserId (state, userId) {
      state.userId = userId
    },
    setImageUrl (state, imageUrl) {
      state.imageUrl = imageUrl
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [persistedPlugin]
})
